<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" th:replace="admin">
<div th:fragment="content">

    <ul class="nav nav-tabs" id="myTab" role="tablist">
        <li class="nav-item" role="presentation">
            <a class="nav-link active" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home" aria-selected="true">所有学生</a>
        </li>
        <li class="nav-item" role="presentation">
            <a class="nav-link" id="profile-tab" data-toggle="tab" href="#profile" role="tab" aria-controls="profile" aria-selected="false">添加学生</a>
        </li>
    </ul>
    <div class="tab-content" id="myTabContent" style="margin-top: 30px">
        <div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">
            <table class="table">
                <thead>
                <tr class="table-danger">
                    <th>序号</th>
                    <th>姓名</th>
                    <th>学号</th>
                    <th>性别</th>
                    <th>班级</th>
                    <th>电话</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="student,it:${studentlist}" class="table-primary">
                    <td th:text="${it.count}">John</td>
                    <td th:text="${student.getName()}">John</td>
                    <td th:text="${student.getStudentId()}">Doe</td>
                    <td th:text="${student.getSex()}"></td>
                    <td th:text="${student.getClasss().getGrade()+student.getClasss().getName()}"></td>
                    <td th:text="${student.getMobile()}"></td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="tab-pane fade"  id="profile" role="tabpanel" aria-labelledby="profile-tab">
            <div class="card" style="width: 600px;margin: 0 auto">
                <div class="card-body">
                    <h3>添加学生</h3>
                    <form action="/register" method="post">
                        <input type="text" class="form-control" name="studentId" placeholder="请输入学号">
                        <br>
                        <input type="text" class="form-control" name="name" placeholder="请输入姓名">
                        <br>
                        <input type="text" class="form-control" name="password" placeholder="密码">
                        <br>
                        <input type="text" class="form-control" name="mobile" placeholder="电话">
                        <br>
                        <select class="form-control" name="sex" id="Select1">
                            <option>男</option>
                            <option>女</option>
                        </select>
                        <br>
                        <select class="form-control" name="grade" id="Select2" placeholder="年级">
                            <option selected>选择年级</option>
                            <option>2016</option>
                            <option>2017</option>
                            <option>2018</option>
                            <option>2019</option>
                        </select>
                        <br>
                        <select class="form-control" name="classsname" id="Select3">
                            <option selected>选择专业</option>
                            <option>计算机科学与技术</option>
                            <option>电子通信工程</option>
                            <option>软件工程</option>
                            <option>大数据</option>
                            <option>人工智能</option>
                        </select>
                        <br>
                        <button type="submit" class="btn btn-primary">提交</button>
                    </form>
                </div>
            </div>
        </div>
        <div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab">...</div>
    </div>

</div>

</html>